<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.joinhawaii.admin.product.*" %>
<%
	String hotel_id		= StringUtil.nvl(request.getParameter("hotel_id"));
	String room_id		= StringUtil.nvl(request.getParameter("room_id"));


	ProductDAO dao 		= new ProductDAO();
	String from_date 	= StringUtil.toDate(dao.selectRoomPriceFromDate(room_id),".");

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>조인하와이</title>
	<%@ include file="/admin/include/cssnjs.jsp"  %>
	<script>

	$(document).ready(function() {
		$('input[name="list.to_date"]').mask('9999.99.99').datepicker();
	});


   	/**
    * btn_Search()
    * 작 성 자 : 이규동
    * 작 성 일 : 2006-04-20
    * 개    요 : 조회 처리
    * return값 : void
    */
    function fnRoomPriceInsert() {
    	if ($('input[name="list.to_date"]').val() == "") {
    		alert("종료일은 필수입력항목입니다.");
    		return;
    	}

    	if ($('input[name="list.to_date"]').val() < "<%= from_date %>") {
			alert("종료일은 시작일보다 작을수 없습니다.");
			return;
		}

    	if (confirm("저장하시겠습니까?")) {
			document.frm.action = "./hotelPriceSave.do?hotel_id=<%=hotel_id%>&tabs_code=3&target=_opener";
			document.frm.submit();
		}
    }



    /**
    * btn_Close()
    * 작 성 자 : 이규동
    * 작 성 일 : 2006-04-20
    * 개    요 :
    * return값 : void
    */
    function btn_Close(){
        self.close();
    }


</script>



</head>

<body>
	<div style="padding:10px">
		<div class="menu_title">
			<h1>객실 가격등록</h1>
		</div>
		<div class="clear line_01"></div>



			<form name="frm" id="frm" method="post" action="">

			<table cellpadding="0" cellspacing="0" class="table_01 mt5">
			<colgroup>
				<col width="100px"/>
				<col/>
			</colgroup>
			<tbody>
				<tr>
					<th><p>시작일</p></th>
					<td class="brx">
			        	<input type="hidden" name="list.job_type" value="C">
			        	<input type="hidden" name="list.room_id" value="<%= room_id %>">
			        	<input type="hidden" name="list.from_date" value="<%= from_date %>">
			        	<%= StringUtil.toDate(from_date, ".") %>
        			</td>
				</tr>
				<tr>
					<th><p>종료일</p></th>
					<td class="brx">
	        			<input type="text" name="list.to_date" id="to_date" value="<%= StringUtil.toDate(from_date, ".") %>" class="w100 c" readOnly >
					</td>
				</tr>
				<tr>
					<th><p>원가</p></th>
					<td class="brx">
						<input type="text" name="list.cost" value="" maxlength="5" class="w100" />
					</td>
				</tr>
				<tr>
					<th><p>판매가</p></th>
					<td class="brx"><input type="text" name="list.price" value="" maxlength="5" class="w100" /></td>
				</tr>
				<tr>
					<th><p>B2B</p></th>
					<td class="brx"><input type="text" name="list.b2b" value="" maxlength="5" class="w100" /></td>
				</tr>
			</tbody>
			</table>

			<div class="mt20 mb10 c">
				<a href="#nohref" onclick="fnRoomPriceInsert()"><img src="/images/admin/btn_register.gif" /></a>
				<a href="#nohref" onclick="self.close()"><img src="/images/admin/btn_close.gif"/></a>
			</div>

			</form>

		</div>
	</div>
	</body>

</html>
